package logic;


public class Simbol{
    String value;
    String type;
    String id;
    
    public Simbol(){
    	this.type="terminal";
		this.value="";
		this.id="";
    }
    
    public Simbol(String value){
    	this.type="terminal";
    	this.value=value;
    	this.id="";
    }

    public Simbol(String value, String type){
    	this.value=value;
		this.type=type;
		this.id="";
    }
    
    public Simbol(String value, String type, String id){
    	this.value=value;
    	this.type=type;
    	this.id=id;
    }

    public String getValue(){
    	return this.value;
    }
    
    public void setValue(String value){
    	this.value=value;
    }

    public String getType(){
    	return this.type;
    }
    
    public void setType(String type){
    	this.type=type;
    }

    public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public String getConway(){
		String conway="";
		conway+=this.id + "[label=\"" + this.value + "\"";
		if(this.type.equals("string")){
		    conway+=" shape=circle";
		}
		conway+="];\n";
		return conway;
    }

	public String getConway2(){
		String conway="";
		conway+=this.value;
		if(this.type.equals("string")){
		    conway+=" [shape=circle]";
		}
		conway+=";\n";
		return conway;
    }

    public String toString(){
		String s="";
		if(type=="string")s+="\""+getValue()+"\" ";
		else s+=getValue()+" ";
		return s;
    }
    
    public boolean equals(String s){
    	boolean eq=false;
    	if(value.equals(s))
    		eq=true;
    	return eq;
    }

}